package com.bidevalution.business.impl;

import java.util.Date;
import java.util.List;

import com.bidevalution.business.service.BeSignLocationDistanceService;
import com.bidevalution.business.service.BeSignLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bidevalution.dao.entity.BeSignLocation;
import com.bidevalution.dao.mapper.BeSignLocationMapper;
@Service
public class BeSignLocationServiceImpl implements BeSignLocationService {
	@Autowired
	private BeSignLocationMapper beSignLocationMapper;
	@Autowired
	private BeSignLocationDistanceService beSignLocationDistanceService;
	@Override
	public void insert(BeSignLocation beSignLocation) {
		
		beSignLocationMapper.insert(beSignLocation);
	}
	@Override
	public List<BeSignLocation> selectList(String sectionId) {
		// TODO Auto-generated method stub
		
        
		return beSignLocationMapper.selectList(sectionId);
	}

	@Override
	public BeSignLocation select(String sectionId, String orgId) {
		
		return beSignLocationMapper.select(sectionId, orgId);
	}
	@Override
	public void updateByPrimaryKey(BeSignLocation record) {
		
		beSignLocationMapper.updateByPrimaryKey(record);
	}
	@Override
	public List<BeSignLocation> selectList(String sectionId, Integer pageNo, Integer pageSize) {
		
		List<BeSignLocation> beSignLocations = beSignLocationMapper.selectForPage(sectionId,(pageNo-1)*pageSize,pageSize);
		for(BeSignLocation beSignLocation:beSignLocations) {
			beSignLocation.setBeSignlocationDistanceList(beSignLocationDistanceService.selectList(beSignLocation.getId()));
		}
		return beSignLocations;
	}
	@Override
	public List<BeSignLocation> selectListByCreateTime(Date startTime) {
		
		return beSignLocationMapper.selectListByCreateTime(startTime);
	}
	@Override
	public int selectCountForPage(String sectionId) {
		
		return beSignLocationMapper.selectCountForPage(sectionId);
	}

}
